<?php

namespace V1;

class IsClickWinning extends \ResourceClass
{
    public $isActive = true;
    public $remark = '返回中奖结果';

    public function get(array $req, array $post, &$result){

        if (!isset($req["uid"])) {
            return "uid not null";
        }
        $checkRes = $this->autoCheck($req['uid']);
        if($checkRes['code'] !== 200){
            return $checkRes['message'];
        }
        /*查看本日是否已点击宝箱*/
        $winning_log = new \Biz\WinningLog();
        $click_res = $winning_log->isClick($req["uid"]);
        $data = array();
        if ($click_res == 1) {
            /*今日宝箱次数已用完*/
            $data["info"]["type"] = 300;
            $data["info"]["name"] = "谢谢惠顾!";
            $data["info"]["memo"] = "谢谢惠顾!";
            $data["info"]["content"] = "谢谢惠顾!";
            $data["info"]["icon_url"] = "谢谢惠顾!";
        }else{
            $data["info"]["type"] = 200;
        }
        $result = $data;
    }
}